Skip to content

perf(@angular/build): fix memory leak in ng serve with i18n#32599

Merged
alan-agius4 merged 1 commit intoangular:mainfrom
alan-agius4:memory-leak-i18n
Feb 26, 2026
Merged

perf(@angular/build): fix memory leak in ng serve with i18n#32599
alan-agius4 merged 1 commit intoangular:mainfrom
alan-agius4:memory-leak-i18n

Conversation

@alan-agius4
Copy link
Collaborator

When running ng serve with i18n configured, every file save (.html files) triggers a rebuild that creates a new piscina ThreadPool for i18n-inline-worker.js. Old pools and their worker threads were not properly cleaned up because the inliner was closed prematurely, causing unbounded memory growth.

This commit ensures that the inliner is kept open while processing template updates, resolving the issue where orphaned threads were created.

Closes #32584

When running `ng serve` with i18n configured, every file save (.html files) triggers a rebuild that creates a new piscina `ThreadPool` for `i18n-inline-worker.js`. Old pools and their worker threads were not properly cleaned up because the inliner was closed prematurely, causing unbounded memory growth.

This commit ensures that the inliner is kept open while processing template updates, resolving the issue where orphaned threads were created.

Closes angular#32584
@alan-agius4 alan-agius4 requested a review from clydin February 26, 2026 10:32
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Feb 26, 2026
@angular-robot angular-robot bot added area: performance Issues related to performance area: @angular/build labels Feb 26, 2026
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 26, 2026
@alan-agius4 alan-agius4 merged commit 9d167ca into angular:main Feb 26, 2026
39 checks passed
@alan-agius4 alan-agius4 deleted the memory-leak-i18n branch February 26, 2026 14:21
@alan-agius4
Copy link
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build area: performance Issues related to performance target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in dev server rebuilds

2 participants